3.2296 \(\int (1+x)^2 (a+b x) (1-x+x^2)^2 \, dx\)

Optimal. Leaf size=44 \[ \frac{a x^7}{7}+\frac{a x^4}{2}+a x+\frac{b x^8}{8}+\frac{2 b x^5}{5}+\frac{b x^2}{2} \]

[Out]

a*x + (b*x^2)/2 + (a*x^4)/2 + (2*b*x^5)/5 + (a*x^7)/7 + (b*x^8)/8

________________________________________________________________________________________

Rubi [A]  time = 0.0283479, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.048, Rules used = {771} \[ \frac{a x^7}{7}+\frac{a x^4}{2}+a x+\frac{b x^8}{8}+\frac{2 b x^5}{5}+\frac{b x^2}{2} \]

Antiderivative was successfully verified.

[In]

Int[(1 + x)^2*(a + b*x)*(1 - x + x^2)^2,x]

[Out]

a*x + (b*x^2)/2 + (a*x^4)/2 + (2*b*x^5)/5 + (a*x^7)/7 + (b*x^8)/8

Rule 771

Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> In
t[ExpandIntegrand[(d + e*x)^m*(f + g*x)*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && N
eQ[b^2 - 4*a*c, 0] && IntegerQ[p] && (GtQ[p, 0] || (EqQ[a, 0] && IntegerQ[m]))

Rubi steps

\begin{align*} \int (1+x)^2 (a+b x) \left (1-x+x^2\right )^2 \, dx &=\int \left (a+b x+2 a x^3+2 b x^4+a x^6+b x^7\right ) \, dx\\ &=a x+\frac{b x^2}{2}+\frac{a x^4}{2}+\frac{2 b x^5}{5}+\frac{a x^7}{7}+\frac{b x^8}{8}\\ \end{align*}

Mathematica [A]  time = 0.0017215, size = 44, normalized size = 1. \[ \frac{a x^7}{7}+\frac{a x^4}{2}+a x+\frac{b x^8}{8}+\frac{2 b x^5}{5}+\frac{b x^2}{2} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + x)^2*(a + b*x)*(1 - x + x^2)^2,x]

[Out]

a*x + (b*x^2)/2 + (a*x^4)/2 + (2*b*x^5)/5 + (a*x^7)/7 + (b*x^8)/8

________________________________________________________________________________________

Maple [A]  time = 0., size = 35, normalized size = 0.8 \begin{align*} ax+{\frac{b{x}^{2}}{2}}+{\frac{a{x}^{4}}{2}}+{\frac{2\,b{x}^{5}}{5}}+{\frac{a{x}^{7}}{7}}+{\frac{b{x}^{8}}{8}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1+x)^2*(b*x+a)*(x^2-x+1)^2,x)

[Out]

a*x+1/2*b*x^2+1/2*a*x^4+2/5*b*x^5+1/7*a*x^7+1/8*b*x^8

________________________________________________________________________________________

Maxima [A]  time = 1.00216, size = 46, normalized size = 1.05 \begin{align*} \frac{1}{8} \, b x^{8} + \frac{1}{7} \, a x^{7} + \frac{2}{5} \, b x^{5} + \frac{1}{2} \, a x^{4} + \frac{1}{2} \, b x^{2} + a x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)^2*(b*x+a)*(x^2-x+1)^2,x, algorithm="maxima")

[Out]

1/8*b*x^8 + 1/7*a*x^7 + 2/5*b*x^5 + 1/2*a*x^4 + 1/2*b*x^2 + a*x

________________________________________________________________________________________

Fricas [A]  time = 1.03459, size = 88, normalized size = 2. \begin{align*} \frac{1}{8} x^{8} b + \frac{1}{7} x^{7} a + \frac{2}{5} x^{5} b + \frac{1}{2} x^{4} a + \frac{1}{2} x^{2} b + x a \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)^2*(b*x+a)*(x^2-x+1)^2,x, algorithm="fricas")

[Out]

1/8*x^8*b + 1/7*x^7*a + 2/5*x^5*b + 1/2*x^4*a + 1/2*x^2*b + x*a

________________________________________________________________________________________

Sympy [A]  time = 0.062244, size = 37, normalized size = 0.84 \begin{align*} \frac{a x^{7}}{7} + \frac{a x^{4}}{2} + a x + \frac{b x^{8}}{8} + \frac{2 b x^{5}}{5} + \frac{b x^{2}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)**2*(b*x+a)*(x**2-x+1)**2,x)

[Out]

a*x**7/7 + a*x**4/2 + a*x + b*x**8/8 + 2*b*x**5/5 + b*x**2/2

________________________________________________________________________________________

Giac [A]  time = 1.0932, size = 46, normalized size = 1.05 \begin{align*} \frac{1}{8} \, b x^{8} + \frac{1}{7} \, a x^{7} + \frac{2}{5} \, b x^{5} + \frac{1}{2} \, a x^{4} + \frac{1}{2} \, b x^{2} + a x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)^2*(b*x+a)*(x^2-x+1)^2,x, algorithm="giac")

[Out]

1/8*b*x^8 + 1/7*a*x^7 + 2/5*b*x^5 + 1/2*a*x^4 + 1/2*b*x^2 + a*x